package com.cn.service.impl;

import java.util.List;

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import ch.qos.logback.classic.Logger;

import com.cn.dao.ProductMapper;
import com.cn.domain.ProductEntity;
import com.cn.service.ProductService;
@Service(value="productService")
 
public class ProductServiceImpl implements ProductService {
	protected static Logger logger=(Logger) LoggerFactory.getLogger(ProductServiceImpl .class);  
	
	@Autowired
	private ProductMapper productMapper;
	
	public int insertProductEntity(ProductEntity product) {
		// TODO Auto-generated method stub
		return productMapper.insertProductEntity(product);
	}

	public List<ProductEntity> findProductEntityByWhere(ProductEntity product) {
		// TODO Auto-generated method stub
		return this.productMapper.findProductEntityByWhere(product);
	}

	public int updateProductEntity(ProductEntity product) {
		// TODO Auto-generated method stub
		return this.productMapper.updateProductEntity(product);
	}
	@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)
	public ProductEntity queryProductForUpdate(ProductEntity product) {
		// TODO Auto-generated method stub
		return this.productMapper.queryProductForUpdate(product);
	}

}
